/********************************************************
 Name          : xmodem.h
 Author        : Khachatur Gyozalyan
 Copyright     : Copyright by Antel Systems
 Description   :
 **********************************************************/
#ifndef XMODEM_H_
#define XMODEM_H_

#include "string.h"
#include "usart_fast.h"
#include "file_system.h"
#include "at25dfx.h"
#include "delay.h"

#define SOH  0x01
#define STX  0x02
#define EOT  0x04
#define ACK  0x06
#define NAK  0x15
#define CAN  0x18
#define CTRLZ 0x1A

#define DLY_1S    1000
#define DLY_500ms 500

#define MAXRETRANS 25

#define XMOD_MAX_RETRY 32

extern struct OperationMode operation_mode;

int xmodemReceive(struct file_t file);
int xmodemTransmit(struct file_t file);

#endif /* XMODEM_H_ */
